<?php
/* 
 * Copyright (c) 2018-2021   All rights reserved.
 * 
 * 创建时间：2021-11-12 22:56
 *
 * 项目：rm  -  $  - footerhtm.php
 *
 * 作者：liwei 
 */


?>

<style>
    .form-mainb {
        margin-bottom: 0;
    }
</style>

<div class="card" style="margin-bottom: 70px">
    <div class="card-header">
        <div class="">分表管理</div>
        <tips>所建分表之间ID不重复，仍然唯一</tips>
        <div class="buttons-row">
            <a class="button button-fill font12 scale8 color-blackg" href="<?=\lev\helpers\UrlHelper::updateSubTableCache()?>">更新缓存</a>
        </div>
    </div>

    <div class="data-xtable">
        <table>
            <tr>
                <th class="wd100">数据表名称</th>
                <th>大小</th>
                <th>存储ID范围</th>
                <th>数据量</th>
                <th>操作</th>
            </tr>
            <?php if (!empty($subTabs)) foreach ($subTabs as $_main => $subs):?>
            <?php foreach ($subs as $v):?>
            <tr>
                <td <?=$_main == $v['subName'] ? 'style="color: red;font-weight: bold;"' : ''?>><?=$v['subName']?></td>
                <td><?=\lev\helpers\subTableHelper::selectTableSize($v['subName'])?></td>
                <td><?=$v['startId'],'-',$v['endId']?></td>
                <td><?=$v['dataRows']?></td>
                <td>
                <?php if ($_main == $v['subName']):?>
                    <a class="button button-fill scale9 font12 transl wd30 wdmin ajaxBtn" href="<?=\lev\helpers\UrlHelper::createSubTable($v['subName'])?>" confirmmsg="<tips>主表【<?=$v['subName']?>】数据自动移至分表</tips><br>分表ID留白【<?=Lev::formatNumber(\modules\levfm\helpers\levfmSetHelper::startId())?>】<br>您确定要创建分表吗？">创建分表</a>
                <?php else:?>
                    <a class="button button-fill scale8 font12 transl wd30 wdmin color-gray ajaxBtn" confirmmsg="<tips>分表【<?=$v['subName']?>】数据自动清空</tips><br>您确定要删除分表吗？" href="<?=\lev\helpers\UrlHelper::dropSubTable($v['subName'])?>">删除分表</a>
                <?php endif;?>
                </td>
            </tr>
            <?php endforeach;?>
            <?php endforeach;?>
        </table>
    </div>
</div>
